<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户详情</title>
    <script src="../lib/vue.js"></script>
    <script src="../lib/axios.min.js"></script>
    <link rel="stylesheet" href="../lib/element_ui.css">
    <style>
        #box{
            width: 30%;
            margin-left: 35%;
            margin-right: 35%;
            margin-top: 5%;
        }
    </style>
</head>
<body>
    <div id="box">
        <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="用户编号" readonly>
                <el-input v-model="form.id"></el-input>
            </el-form-item>
            <el-form-item label="用户姓名">
                <el-input v-model="form.username"></el-input>
            </el-form-item>
            <el-form-item label="用户密码">
                <el-input v-model="form.password"></el-input>
            </el-form-item>
            <el-form-item label="用户性别">
                <el-radio-group v-model="form.gender">
                    <el-radio label="true"></el-radio>
                    <el-radio label="false"></el-radio>
                </el-radio-group>
            </el-form-item>
            <el-form-item label="注册时间">
                <el-input v-model="form.registTime"></el-input>
            </el-form-item>
            <el-button type="primary" @click="changeInfo()">确定</el-button>
        </el-form>
    </div>
    <script src="../lib/element_ui.js"></script>
    <script>
        var vm = new Vue({
            el:"#box",
            data:{
                form:{
                    id:"",
                    username:"",
                    password:"",
                    gender:"",
                    registTime:""
                }
            },
            methods: {
                changeInfo(){
                    axios.post("/changeinfo", this.form).then(item=>{
                        console.log(item.data);
                        window.location.href = item.data;
                    });
                }
            },
            mounted() {
                axios.get("/getinfo").then(item=>{this.form = item.data});
            }
        });
    </script>
</body>
</html>